<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!-- 头部 -->
	<div id="box_top">
		<div class="top">
			<div class="left fl">
				<img src="http://localhost/hu_cms/template/default/images/logo.gif" alt="logo">
			</div>
			<div class="right fr">
				<p>
					<a href="">设为首页</a><span>|</span>
					<a href="">加入收藏</a><span>|</span>
					<a href="">联系我们</a>
				</p>
				<form action="" method="post">
					<input type="text" name="key" class="input_text fl" size="28" placeholder="请输入关键词">
					<input type="submit" class="sub fl" value="搜索">
				</form>
			</div>
		</div>
	</div>

<!-- 菜单导航 -->

<div id="menu">
	<ul class="nav">
		<li class="hover"><a href="http://localhost/hu_cms">网站首页</a></li>
		<?php $hd["list"]["c"]["total"]=0;if(isset($data) && !empty($data)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($data));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($data,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

			<li><img src="http://localhost/hu_cms/template/default/images/nav_mid.png"></li>
			<li>
				<a href="<?php echo U('Index/Index/category',array('cid'=>$c['cid']));?>"><?php echo $c['catname'];?></a>
				<dl style="display: none;">
							<?php
		   $cid=$c['cid'];
		   $type=son;
		   $db=M('category');

		   switch ($type) {
		   	case 'self':
				$cat= $db->find($c['cid']);
				$data=$db->where("pid=".$cat['pid'])->all();
		   		break;
		   	
		   	case 'son':
				$data=$db->where("pid=".$cid)->all();
		   		break;
		   }
		  foreach($data as $field):
				$field['caturl']=U('Index/Index/category',array('cid'=>$field['cid']));
		 ?>	
						<dt>
							<a href="<?php echo $field['caturl'];?>"><?php echo $field['catname'];?></a>
						</dt>
					<?php endforeach; ?>
				</dl>
			</li>
		<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>

	</ul>
</div>